package com.course.entity;

// 抽象父类，提取Student和Teacher的共性
public abstract class Person {
    // protected修饰：子类可访问，同包类可访问，其他包不可直接访问
    protected String id;
    protected String name;
    protected String gender;

    // 父类构造方法
    public Person(String id, String name, String gender) {
        this.id = id;
        this.name = name;
        this.gender = gender;
    }

    // public方法：所有包可见
    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getGender() {
        return gender;
    }

    // 抽象业务方法：子类必须实现
    public abstract void printWorksheet();
}